﻿@model GSLMS.Entity.TB_SYS_EMP
@{
    Layout = null;
    ViewBag.Title = "登录";
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>GSLMS</title>@*<link href="/Content/DWZ/themes/css/login.css" rel="stylesheet" type="text/css" />*@
    <style type="text/css">
        body
        {
            /*background:#c9c9c9 url(./images/login/bg-body.gif) 0 0 repeat-x;*/
            font: normal normal 100% Helvetica, Arial, sans-serif;
            font-size: 12px;
            color: #666;
            margin: 0;
            padding: 0;
            text-align: center;
        }
        a img
        {
            border: none;
        }
        p
        {
            margin: 5px 0;
            padding: 0;
        }
        #corpLogo
        {
            float: left;
            width: 100%;
            text-align: center;
            margin-top: 100px;
        }
        #login
        {
            width: 447px;
            height: 391px;
            margin: 0 auto;
            background: url(/Content/DWZ/themes/default/images/bg-login.jpg) no-repeat;
            text-align: left;
        }
        #logo
        {
            margin: 0 0 10px 0;
            height: 36px;
            background: url(/Content/DWZ/themes/default/images/login-logo.gif) 0 0 no-repeat;
            text-indent: -9999em;
        }
        #login-box
        {
            height: 190px;
            padding-top: 77px;
            padding-left: 100px;
            margin-bottom: 15px;
        }
        #login-box .input
        {
            width: 130px;
            padding: 1px;
        }
        #login-box .input2
        {
            width: 75px;
            padding: 1px;
        }
        #login-box label
        {
            color: #FFF;
            padding-right: 5px;
        }
        #login-box .login-btn
        {
            margin-top: 15px;
            padding-left: 55px;
        }
        .btn-login, .btn-cancel
        {
            width: 74px;
            height: 24px;
            border: none;
            cursor: pointer;
            color: #000;
            font-size: 14px;
            font-weight: bold;
        }
        .btn-login
        {
            background: url(/Content/DWZ/themes/default/images/login-btn.jpg) 0 0 no-repeat;
        }
        .btn-cancel
        {
            background: url(/Content/DWZ/themes/default/images/bg-login-btn.gif) 0 -25px no-repeat;
            color: #000;
        }
        #login-foot
        {
            text-align: center;
        }
        address
        {
            font-style: normal;
        }
        #login-box p
        {
            margin: 0 0 20px;
            padding: 0;
        }
        .red
        {
            color: red;
        }
        ul, li
        {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .tips
        {
            position: absolute;
            right: 0;
            top: 0;
            background: #FFC;
            border: 1px solid red;
            padding: 5px;
            text-align: center;
        }
    </style>
    <script src="/Scripts/md5.js" type="text/javascript"></script>
    @Scripts.Render("~/bundles/jquery")
    @*    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/DWZ")
*@
    <script>
        function login() {
            var User = $("#User").val();
            var Pwd = $("#Pwd").val();
            var code = $("#code").val();

            code = "1111";

            if (User == "" || Pwd == "" || code == "") {
                alert("账号，密码和验证码不能为空");
                return false;
            }

            Pwd = b64_md5(Pwd);

            $.ajax({
                type: "POST",
                url: "/login/validate",
                data: "User=" + User + "&Pwd=" + Pwd + "&code=" + code,
                success: function (data) {
                    var json = eval("(" + data + ")");
                    if (json.statusCode == 200) {
                        window.location = '@Url.Action("index", "main")';
                    }
                    else {
                        $("#valiCode").click();
                        $("#code").val("");
                        alert(json.message);
                    }
                }
            });
            return false;
        }
    </script>
</head>
<body style="background-color: #ffffff">
    <form action="/login/validate" onsubmit="return login();">
    <div id="corpLogo">
        @*<img alt="" src="/Content/DWZ/themes/default/images/LoginLogo.png" style="width:550px;"/>*@
    </div>
    <div id="login">
        <div id="login-box">
            <p>
                <label>
                    用户名：</label>
                <input type="text" name="User" id="User" class="input" value="" />
            </p>
            <p>
                <label>
                    密&nbsp;&nbsp;&nbsp;&nbsp;码：</label>
                <input type="password" name="Pwd" id="Pwd" class="input" value="" />
            </p>
            <p>
                <label>
                    验证码：</label>
                <input  class="input2"  name="code" id="code" type="text" size="5" value="@Session["ValidateCode"]"/>
                <span style="padding-top: 5px;">
                    <img id="valiCode" style="vertical-align:top;cursor:pointer;" src="/login/GetValidateCode?@DateTime.Now" alt="验证码"
                            onclick="this.src='/login/GetValidateCode?time=' + (new Date()).getTime();" />
                </span>
            </p>
            <p class="login-btn">
                <input type="submit" value=" 登 录 " class="btn-login" />
            </p>
        </div>
        <div id="login-foot">
            <address>
                Copyright &copy; 2013<script type="text/javascript">                                         var rDate = new Date(); if (rDate.getFullYear() != 2013) { document.write("-" + rDate.getFullYear()); }</script>
                深圳国软科技有限公司 Ver @System.Reflection.Assembly.LoadFrom(Server.MapPath("~/bin/GSLMS.WebAPP.DLL")).GetName().Version.ToString()
            </address>
        </div>
    </div>
    </form>
</body>
</html>
